home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume91 / aplictns / mandset1 / part01
Encoding:
Internet Message Format  |  1991-05-08  |  54.3 KB

  1. Path: news.larc.nasa.gov!amiga-request
  2. From: amiga-request@ab20.larc.nasa.gov (Amiga Sources/Binaries Moderator)
  3. Subject: v91i097: MandelbrotSet 1.2 - generate and save mandelbrot and julia sets, Part01/01
  4. Reply-To: RWALLACE%vax1.tcd.ie@pucc.PRINCETON.EDU
  5. Newsgroups: comp.sources.amiga
  6. Message-ID: <comp.sources.amiga:v91i097@ab20.larc.nasa.gov>
  7. Date: 08 May 91 00:15:40 GMT
  8. Approved: tadguy@uunet.UU.NET (Tad Guy)
  9. X-Mail-Submissions-To: amiga@uunet.uu.net
  10. X-Post-Discussions-To: comp.sys.amiga.misc
  11.  
  12. Submitted-by: RWALLACE%vax1.tcd.ie@pucc.PRINCETON.EDU
  13. Posting-number: Volume 91, Issue 097
  14. Archive-name: applications/mandset-1.2/part01
  15.  
  16. [ includes uuencoded executable and icons  ...tad ]
  17.  
  18.      The program in this drawer will display the Mandelbrot and Julia 
  19. sets and save them to disk as IFF files. Each image takes several hours 
  20. to generate, though programs which allow multitasking can be used while 
  21. this is going on.
  22.  
  23. #!/bin/sh
  24. # This is a shell archive.  Remove anything before this line, then unpack
  25. # it by saving it into a file and typing "sh file".  To overwrite existing
  26. # files, type "sh file -c".  You can also feed this as standard input via
  27. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  28. # will see the following message at the end:
  29. #        "End of archive 1 (of 1)."
  30. # Contents:  Mandelbrot_Set.c Mandelbrot_Set.doc console.c input.c
  31. #   makefile mandelbrot0.uu mandelbrot1.uu mandelbrot_.uu saveilbm.c
  32. #   scanfloat.c
  33. # Wrapped by tadguy@ab20 on Tue May  7 20:15:39 1991
  34. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  35. if test -f 'Mandelbrot_Set.c' -a "${1}" != "-c" ; then 
  36.   echo shar: Will not clobber existing file \"'Mandelbrot_Set.c'\"
  37. else
  38. echo shar: Extracting \"'Mandelbrot_Set.c'\" \(8069 characters\)
  39. sed "s/^X//" >'Mandelbrot_Set.c' <<'END_OF_FILE'
  40. X/* Mandelbrot and Julia set program by Russell Wallace 1987. Requires linkage
  41. X   with files saveilbm.o input.o console.o. If using Aztec C,
  42. X   also link with m.lib and use +L compile option.
  43. X
  44. X   Original version developed with Aztec C 3.2a. Version 1.1 recompiled with
  45. X   Lattice C 4.0 1 October 1988, not because I think Lattice C is better than
  46. X   Aztec overall but because I can get Lattice to do double-precision floating
  47. X   point (though not using the standard Amiga libraries) whereas the Aztec
  48. X   version only used single precision which severely restricted the detail
  49. X   which could be plotted. Use the enclosed makefile with Aztec C's make
  50. X   utility to compile under Lattice (if you have both compilers...)
  51. X
  52. X   Version 1.2 24 October 1988 with Lattice C 4.0, uses NTSC/PAL vertical
  53. X   resolution depending on the system it's running on. Also correctly displays
  54. X   the region far from the Mandelbrot set as color 0. */
  55. X
  56. X#include <exec/exec.h>
  57. X#include <exec/execbase.h>
  58. X#include <hardware/blit.h>
  59. X#include <graphics/copper.h>
  60. X#include <graphics/regions.h>
  61. X#include <graphics/gfxbase.h>
  62. X#include <graphics/gfxmacros.h>
  63. X#include <graphics/gels.h>
  64. X#include <intuition/intuition.h>
  65. X
  66. Xstruct IntuitionBase *IntuitionBase=NULL;
  67. Xstruct GfxBase *GfxBase=NULL;
  68. X
  69. X#define MAXX 320
  70. Xint maxy;
  71. X#define NUMITEMS 5        /* 5 items in menu */
  72. X#define BUFLEN 50        /* Length of input buffer */
  73. X
  74. Xshort input ();
  75. Xlong saveilbm (),start ();
  76. X
  77. Xchar inbuf[BUFLEN];
  78. X
  79. Xstruct NewScreen MyScreen=
  80. X{
  81. X    0,0,
  82. X    MAXX,0,
  83. X    5,0,31,
  84. X    0,
  85. X    CUSTOMSCREEN,
  86. X    0,
  87. X    "Mandelbrot Set v1.2",
  88. X    0,0
  89. X};
  90. X
  91. Xstruct NewWindow DrawWindow=
  92. X{
  93. X    0,0,
  94. X    MAXX,0,
  95. X    0,31,
  96. X    MENUPICK,
  97. X    BORDERLESS|BACKDROP|ACTIVATE,
  98. X    0,
  99. X    0,
  100. X    0,
  101. X    0,
  102. X    0,
  103. X    0,
  104. X    0,
  105. X    0,
  106. X    0,
  107. X    CUSTOMSCREEN
  108. X};
  109. X
  110. Xstruct Screen *Screen=NULL;
  111. Xstruct Window *Backdrop=NULL;
  112. Xstruct RastPort *DrawRP;
  113. Xstruct ViewPort *DrawVP;
  114. Xstruct IntuiMessage *message;
  115. X
  116. Xstruct MenuItem MenuItems[NUMITEMS];
  117. Xstruct IntuiText MenuText[NUMITEMS];
  118. Xstruct Menu Menu[1];
  119. X
  120. XBYTE titlebar=TRUE;
  121. XUSHORT palette[]={0x000,0xF00,0xF20,0xF40,
  122. X                  0xF60,0xF80,0xFA0,0xFC0,
  123. X                  0xFE0,0xFF0,0xEF0,0xCF0,
  124. X                  0xAF0,0x8F0,0x6F0,0x4F0,
  125. X                  0x2F0,0x0F0,0x0E2,0x0C4,
  126. X                  0x0A6,0x088,0x06A,0x04C,
  127. X                  0x02E,0x00F,0x10F,0x40F,
  128. X                  0x80F,0xB0F,0xF0F,0xAAA};    /* Color palette in hex */
  129. X
  130. Xmain ()
  131. X{
  132. X    ULONG class;
  133. X    USHORT code,ItemNum;
  134. X    IntuitionBase=(struct IntuitionBase *)OpenLibrary ("intuition.library",0);
  135. X        /* Come on, when is intuition.library not going to be available? */
  136. X    GfxBase=(struct GfxBase *)OpenLibrary ("graphics.library",0);
  137. X        /* Ditto graphics.library */
  138. X    MyScreen.Height=DrawWindow.Height=maxy=GfxBase->NormalDisplayRows;
  139. X        /* Fetch PAL/NTSC screen height values */
  140. X    if (!(Screen=(struct Screen *)OpenScreen (&MyScreen)))
  141. X    {
  142. X        cleanup ();
  143. X        exit (3);
  144. X    }
  145. X    DrawWindow.Screen=Screen;
  146. X    if (!(Backdrop=(struct Window *)OpenWindow (&DrawWindow)))
  147. X    {
  148. X        cleanup ();
  149. X        exit (4);
  150. X    }
  151. X    DrawRP=Backdrop->RPort;
  152. X    DrawVP=&Screen->ViewPort;
  153. X    setcols ();
  154. X    initmenuitems ();
  155. X    initmenu ();
  156. X    SetMenuStrip (Backdrop,&Menu[0]);
  157. X    SetRast (DrawRP,0);
  158. X
  159. X    FOREVER
  160. X    {
  161. X        WaitPort (Backdrop->UserPort);
  162. X        while (message=(struct IntuiMessage *)GetMsg (Backdrop->UserPort))
  163. X        {
  164. X            class=message->Class;
  165. X            code=message->Code;
  166. X            ReplyMsg (message);
  167. X            if (class==MENUPICK && code!=MENUNULL)
  168. X            {
  169. X                ItemNum=ITEMNUM (code);
  170. X                switch (ItemNum)
  171. X                {
  172. X                    case 0:        /* Show/hide title bar */
  173. X                        ClearMenuStrip (Backdrop);
  174. X                        if (titlebar==TRUE)
  175. X                        {
  176. X                            titlebar=FALSE;
  177. X                            ShowTitle (Screen,0);
  178. X                            MenuText[0].IText=(UBYTE *)"Show Title Bar";
  179. X                        }
  180. X                            else
  181. X                            {
  182. X                                titlebar=TRUE;
  183. X                                ShowTitle (Screen,1);
  184. X                                MenuText[0].IText=(UBYTE *)"Hide Title Bar";
  185. X                            }
  186. X                        SetMenuStrip (Backdrop,Menu);
  187. X                        break;
  188. X                    case 1:        /* Do Mandelbrot Set */
  189. X                        doset (0);
  190. X                        break;
  191. X                    case 2:        /* Do Julia Set */
  192. X                        doset (1);
  193. X                        break;
  194. X                    case 3:        /* Save screen */
  195. X                        if (titlebar)
  196. X                            ShowTitle (Screen,0);
  197. X                        savescreen ();
  198. X                        if (titlebar)
  199. X                            ShowTitle (Screen,1);
  200. X                        break;
  201. X                    case 4:        /* Exit */
  202. X                        ClearMenuStrip (Backdrop);
  203. X                        cleanup ();
  204. X                        exit (0);
  205. X                }
  206. X            }
  207. X        }
  208. X    }
  209. X}
  210. X
  211. Xsavescreen ()
  212. X{
  213. X    if (!(start (Screen,"Save screen")))
  214. X    {
  215. X        DisplayBeep (Screen);
  216. X        return;
  217. X    }
  218. X    print ("Enter filename:\n");
  219. X    inbuf[0]='\0';
  220. X    if (input (inbuf,BUFLEN)==-1000)
  221. X    {
  222. X        finish ();
  223. X        return;
  224. X    }
  225. X    finish ();
  226. X    if (saveilbm (DrawRP->BitMap,palette,inbuf))
  227. X        DisplayBeep (Screen);
  228. X}
  229. X
  230. Xdoset (type)
  231. Xint type;
  232. X{
  233. X    register short n,i,j;
  234. X    double x,y,xx,a,b,xgap,ygap,xsquared,ysquared;
  235. X    double x1,y1,x2,y2,cx,cy,scanfloat ();
  236. X    if (!(start (Screen,"Enter Parameters")))
  237. X    {
  238. X        DisplayBeep (Screen);
  239. X        return;
  240. X    }
  241. X    if (type)
  242. X    {
  243. X        print ("Enter X component of C:\n");
  244. X        inbuf[0]='\0';
  245. X        if (input (inbuf,BUFLEN)==-1000)
  246. X        {
  247. X            finish ();
  248. X            return;
  249. X        }
  250. X        cx=scanfloat (inbuf);
  251. X        print ("Enter Y component of C:\n");
  252. X        inbuf[0]='\0';
  253. X        if (input (inbuf,BUFLEN)==-1000)
  254. X        {
  255. X            finish ();
  256. X            return;
  257. X        }
  258. X        cy=scanfloat (inbuf);
  259. X    }
  260. XENTERAGAIN:
  261. X    print ("Enter bottom left X co-ord:\n");
  262. X    inbuf[0]='\0';
  263. X    if (input (inbuf,BUFLEN)==-1000)
  264. X    {
  265. X        finish ();
  266. X        return;
  267. X    }
  268. X    x1=scanfloat (inbuf);
  269. X    print ("Enter bottom left Y co-ord:\n");
  270. X    inbuf[0]='\0';
  271. X    if (input (inbuf,BUFLEN)==-1000)
  272. X    {
  273. X        finish ();
  274. X        return;
  275. X    }
  276. X    y1=scanfloat (inbuf);
  277. X    print ("Enter top right X co-ord:\n");
  278. X    inbuf[0]='\0';
  279. X    if (input (inbuf,BUFLEN)==-1000)
  280. X    {
  281. X        finish ();
  282. X        return;
  283. X    }
  284. X    x2=scanfloat (inbuf);
  285. X    print ("Enter top right Y co-ord:\n");
  286. X    inbuf[0]='\0';
  287. X    if (input (inbuf,BUFLEN)==-1000)
  288. X    {
  289. X        finish ();
  290. X        return;
  291. X    }
  292. X    y2=scanfloat (inbuf);
  293. X    if (y2<=y1 || x2<=x1)
  294. X    {
  295. X        print ("Invalid co-ordinates!\n");
  296. X        goto ENTERAGAIN;
  297. X    }
  298. X    finish ();
  299. X    SetRast (DrawRP,0);
  300. X    xgap=(x2-x1)/MAXX;
  301. X    ygap=(y2-y1)/maxy;
  302. X    b=y1;    /* Y co-ord */
  303. X    for (j=maxy-1;j>=0;j--)    /* Run up screen */
  304. X    {
  305. X        a=x1;
  306. X        for (i=0;i<MAXX;i++)    /* Run across row on screen */
  307. X        {
  308. X            n=0;
  309. X            x=a;    /* x,y contain temporary co-ords of current point */
  310. X            y=b;    /* which will be used in calculations */
  311. X            xsquared=x*x;
  312. X            ysquared=y*y;
  313. X                    /* calculate squares for initial check in loop */
  314. X            if (type==0)    /* Mandelbrot set */
  315. X                while (n<511 && xsquared+ysquared<4)
  316. X                {
  317. X                    xsquared=x*x;
  318. X                    ysquared=y*y;
  319. X                    xx=xsquared-ysquared+a;
  320. X                    y*=x;
  321. X                    y+=y;
  322. X                    y+=b;
  323. X                    x=xx;
  324. X                    n++;
  325. X                }
  326. X            else    /* Julia set */
  327. X                while (n<511 && xsquared+ysquared<4)
  328. X                {
  329. X                    xsquared=x*x;
  330. X                    ysquared=y*y;
  331. X                    xx=xsquared-ysquared+cx;
  332. X                    y=2*x*y+cy;
  333. X                    x=xx;
  334. X                    n++;
  335. X                }
  336. X            SetAPen (DrawRP,(long)(n&31));    /* Color point depending on n */
  337. X            WritePixel (DrawRP,(long)i,(long)j);
  338. X            a+=xgap;    /* Increment logical X co-ord */
  339. X        }
  340. X        b+=ygap;    /* Increment logical Y co-ord */
  341. X    }
  342. X}
  343. X
  344. Xsetcols ()
  345. X{
  346. X    short i;
  347. X    for (i=0;i<32;i++)
  348. X        SetRGB4 (DrawVP,(long)i,(long)((palette[i] & 0xF00)>>8),(long)((palette[i] & 0xF0)>>4),(long)(palette[i] & 0xF));
  349. X}
  350. X
  351. Xinitmenuitems ()
  352. X{
  353. X    register short n;
  354. X    for (n=0;n<NUMITEMS;n++)
  355. X    {
  356. X        MenuItems[n].LeftEdge=0;
  357. X        MenuItems[n].TopEdge=10*n;
  358. X        MenuItems[n].Width=144;        /* 8 times no. of chars */
  359. X        MenuItems[n].Height=10;
  360. X        MenuItems[n].Flags=ITEMTEXT|ITEMENABLED|HIGHCOMP;
  361. X        MenuItems[n].MutualExclude=0;
  362. X        MenuItems[n].ItemFill=(APTR)&MenuText[n];
  363. X        MenuItems[n].SelectFill=NULL;
  364. X        MenuItems[n].Command=0;
  365. X        MenuItems[n].SubItem=NULL;
  366. X        MenuItems[n].NextSelect=0;
  367. X        MenuItems[n].NextItem=&MenuItems[n+1];
  368. X        MenuText[n].FrontPen=0;
  369. X        MenuText[n].BackPen=31;
  370. X        MenuText[n].DrawMode=JAM2;
  371. X        MenuText[n].LeftEdge=0;
  372. X        MenuText[n].TopEdge=1;
  373. X        MenuText[n].ITextFont=0;
  374. X        MenuText[n].NextText=0;
  375. X    }
  376. X    MenuItems[NUMITEMS-1].NextItem=NULL;
  377. X    MenuText[0].IText=(UBYTE *)"Hide Title Bar";
  378. X    MenuText[1].IText=(UBYTE *)"Do Mandelbrot Set";
  379. X    MenuText[2].IText=(UBYTE *)"Do Julia Set";
  380. X    MenuText[3].IText=(UBYTE *)"Save Screen";
  381. X    MenuText[4].IText=(UBYTE *)"Exit";
  382. X}
  383. X
  384. Xinitmenu ()
  385. X{
  386. X    Menu[0].NextMenu=0;
  387. X    Menu[0].LeftEdge=0;
  388. X    Menu[0].TopEdge=0;
  389. X    Menu[0].Width=85;
  390. X    Menu[0].Height=10;
  391. X    Menu[0].Flags=MENUENABLED;
  392. X    Menu[0].MenuName="Options";
  393. X    Menu[0].FirstItem=&MenuItems[0];
  394. X}
  395. X
  396. Xcleanup ()
  397. X{
  398. X    if (Backdrop)
  399. X        CloseWindow (Backdrop);
  400. X    if (Screen)
  401. X        CloseScreen (Screen);
  402. X    CloseLibrary (GfxBase);
  403. X    CloseLibrary (IntuitionBase);
  404. X}
  405. END_OF_FILE
  406. if test 8069 -ne `wc -c <'Mandelbrot_Set.c'`; then
  407.     echo shar: \"'Mandelbrot_Set.c'\" unpacked with wrong size!
  408. fi
  409. # end of 'Mandelbrot_Set.c'
  410. fi
  411. if test -f 'Mandelbrot_Set.doc' -a "${1}" != "-c" ; then 
  412.   echo shar: Will not clobber existing file \"'Mandelbrot_Set.doc'\"
  413. else
  414. echo shar: Extracting \"'Mandelbrot_Set.doc'\" \(4263 characters\)
  415. sed "s/^X//" >'Mandelbrot_Set.doc' <<'END_OF_FILE'
  416. X                    THE MANDELBROT SET
  417. X
  418. XA complex number is of the form a+bi, where i represents the square root 
  419. Xof minus one. Two complex numbers are added by simply adding their 
  420. Xcomponents. Two complex numbers are multiplied as follows:
  421. X
  422. X     (a+bi)(c+di) = ac + cbi + adi - db
  423. X
  424. Xremembering that i squared = -1. Complex numbers can be thought of as 
  425. Xpoints on a plane, with a representing the X co-ordinate and b the Y 
  426. Xco-ordinate. Now take the operation:
  427. X
  428. X     z = z*z + c
  429. X
  430. Xwhere z and c are complex numbers. If z is initially set to 0 and c is a 
  431. Xpoint on the plane, iterating (repeating) this operation many times will 
  432. Xcause the point represented by z to wander in an irregular pattern. Some 
  433. Xinitial values of c will cause z to increase without limit, while other 
  434. Xvalues will cause it to always stay within a certain range. In fact, if 
  435. Xthe distance of z from the origin (i.e. sqrt (a*a + b*b)) ever exceeds 2, 
  436. Xz is destined to wander to infinity. The Mandelbrot set is the set of all 
  437. Xpoints 
  438. Xwhich will always stay within a finite range, no matter how many times 
  439. Xthe operation is applied.
  440. X     Suppose that for every point within a rectangular area of the plane, 
  441. Xwe use the point as an initial value for c and do z=z*z+c until either 
  442. Xwe've done it 1000 times or the distance of z from the origin exceeds 2. 
  443. XThe points for which we only had to do it a few times are far away from 
  444. Xthe Mandelbrot set. Those which required a lot of iterations are close to 
  445. Xit, and the ones which were still within 2 after 1000 calculations are, 
  446. Xas far as we can tell, within it. (There will be a few points which would 
  447. Xhave exceeded 2 after more than 1000 iterations; 1000 is a reasonable 
  448. Xcompromise between processing time and accuracy.) If we now plot the 
  449. Xpoints on a computer screen using different colors to represent varying 
  450. Xdistances from the Mandelbrot set, a striking and colorful display can be 
  451. Xcreated.
  452. X     The Mandelbrot set is of finite size, and if a large region of the 
  453. Xplane is plotted it looks like a small blob of color floating in a vast 
  454. Xuniform sea. Co-ordinate ranges of X from -2 to .5 and Y from -1.25 to 
  455. X1.25 more or less display the full set, you can input a narrower range of 
  456. Xvalues to zoom in on a region near the edge of the set, then zoom in on a 
  457. Xsmall part of this region, etc. The boundary of the set is a fractal - it 
  458. Xshows similar but not identical detail at every scale, and is infinitely 
  459. Xconvoluted. The limit of magnification is determined by the precision to 
  460. Xwhich the calculations are done. The Amiga stores double precision 
  461. Xnumbers to about 16 digits. This means that, if the Mandelbrot set were 
  462. Xthe size of Western Europe, the smallest distinguishable elements of it 
  463. Xwould be the size of atoms.
  464. X     For the Mandelbrot set, we used the array of points to provide 
  465. Xstarting values for c and always set z to 0. If we use different fixed 
  466. Xstarting values of z, the result is simply a distorted version of the set 
  467. X- as a writer in Scientific American magazine put it, "one prefers the 
  468. Xcanonical object". What happens if we use a fixed value of c and obtain 
  469. Xthe starting value of z from the array of points? In this case a Julia 
  470. Xset is displayed - a different one for each value of c. Julia sets, like 
  471. Xthe Mandelbrot set, are fractals, and their overall shape is related to 
  472. Xthe position of c in the Mandelbrot set.
  473. X     The program in this drawer will display the Mandelbrot and Julia 
  474. Xsets and save them to disk as IFF files. Each image takes several hours 
  475. Xto generate, though programs which allow multitasking can be used while 
  476. Xthis is going on. When asked to enter the co-ordinate ranges, note that 
  477. Xincreasing Y values are plotteed up the screen not down, and that the 
  478. Xbottom left co-ordinates must be less than the top-right corner ones. Now 
  479. Xfor the legal and financial stuff. This is a shareware program. You may 
  480. Xfreely copy it, put it on bulletin boards etc. If you have not already 
  481. Xpaid for this copy and wish to use it, please send a small 
  482. Xcontribution to: Russell Wallace, 24 Lower Georges St, Dunlaoghaire, Co. 
  483. XDublin, Ireland. Further programs and example images can be obtained by 
  484. Xsending a blank disk (or better still, a disk with some interesting stuff 
  485. Xon it) to the same source.
  486. END_OF_FILE
  487. if test 4263 -ne `wc -c <'Mandelbrot_Set.doc'`; then
  488.     echo shar: \"'Mandelbrot_Set.doc'\" unpacked with wrong size!
  489. fi
  490. # end of 'Mandelbrot_Set.doc'
  491. fi
  492. if test -f 'console.c' -a "${1}" != "-c" ; then 
  493.   echo shar: Will not clobber existing file \"'console.c'\"
  494. else
  495. echo shar: Extracting \"'console.c'\" \(6098 characters\)
  496. sed "s/^X//" >'console.c' <<'END_OF_FILE'
  497. X
  498. X/* Console routines by Russell Wallace 1987, some obtained from other programs
  499. X * books etc. Feel free to copy them or use them in your own programs. Use
  500. X * +L option if compiling with Aztec C. */
  501. X
  502. X#include "exec/exec.h"
  503. X#include "devices/console.h"
  504. X#include "devices/keymap.h"
  505. X#include "libraries/dos.h"
  506. X#include "intuition/intuition.h"
  507. X
  508. X#define INTUITION_MESSAGE (1<<intuitionMsgBit)
  509. X#define TYPED_CHARACTER (1<<consoleReadBit)
  510. X#define CloseConsole(x) CloseDevice(x)
  511. X#define XOFFSET 26
  512. X#define YOFFSET 39
  513. X
  514. Xextern struct Window *OpenWindow ();
  515. Xextern struct MsgPort *CreatePort ();
  516. Xextern struct IOStdReq *CreateStdIO ();
  517. X
  518. Xshort line,column;
  519. Xint class,code;
  520. Xstruct NewWindow mynewwindow=
  521. X{
  522. X    20,20,        /* x,y co-ords of top left corner */
  523. X    280,100,    /* start size */
  524. X    0,31,        /* detailpen,blockpen */
  525. X    MENUPICK|CLOSEWINDOW,    /* want to know if these happen */
  526. X    ACTIVATE|GIMMEZEROZERO|WINDOWDRAG|WINDOWCLOSE,
  527. X    0,0,0,0,0,
  528. X    120,88,        /* minimum size */
  529. X    640,256,    /* maximum size */
  530. X    CUSTOMSCREEN
  531. X};
  532. Xstruct IOStdReq *consoleWriteMsg=0;
  533. Xstruct IOStdReq *consoleReadMsg=0;
  534. Xstruct MsgPort *consoleWritePort=0;
  535. Xstruct MsgPort *consoleReadPort=0;
  536. Xunsigned char letter;
  537. Xstruct Window *mywindow=0;
  538. Xstruct IntuiMessage *con_message;
  539. X
  540. X    /* Start() must be called at beginning; returns window pointer - if 0,
  541. X     * program has failed ... everything already cleaned up here, main ()
  542. X     * must do its own cleaning up then exit */
  543. X
  544. Xstruct Window *start (screen,title)
  545. Xstruct Screen *screen;
  546. Xchar *title;
  547. X{
  548. X    int consoleReadBit,intuitionMsgBit;
  549. X    line=column=0;
  550. X    mynewwindow.Title=title;
  551. X    mynewwindow.Screen=screen;
  552. X    if (!(mywindow=OpenWindow (&mynewwindow)))
  553. X        goto FAILED;
  554. X    if (!(consoleWritePort=CreatePort ("my.con.write",0)))
  555. X        goto FAILED;
  556. X    if (!(consoleReadPort=CreatePort ("my.con.read",0)))
  557. X        goto FAILED;
  558. X    if (!(consoleWriteMsg=CreateStdIO (consoleWritePort)))
  559. X        goto FAILED;
  560. X    if (!(consoleReadMsg=CreateStdIO (consoleReadPort)))
  561. X        goto FAILED;
  562. X    if (OpenConsole (consoleWriteMsg,consoleReadMsg,mywindow))
  563. X        goto FAILED;
  564. X    QueueRead (consoleReadMsg,&letter);
  565. X    consoleReadBit=consoleReadPort->mp_SigBit;
  566. X    intuitionMsgBit=mywindow->UserPort->mp_SigBit;
  567. X    SetAPen (mywindow->RPort,2);
  568. X    return (mywindow);
  569. XFAILED:
  570. X    closeall ();
  571. X    return (0L);
  572. X}
  573. X
  574. X    /* Call finish() at the end IF start() was successful */
  575. X
  576. Xfinish ()
  577. X{
  578. X    AbortIO (consoleReadMsg);
  579. X    CloseConsole (consoleWriteMsg);
  580. X    closeall ();
  581. X}
  582. X
  583. Xcloseall ()
  584. X{
  585. X    if (mywindow)
  586. X        CloseWindow (mywindow);
  587. X    if (consoleWritePort)
  588. X        DeletePort (consoleWritePort);
  589. X    if (consoleReadPort)
  590. X        DeletePort (consoleReadPort);
  591. X    if (consoleWriteMsg)
  592. X        DeleteStdIO (consoleWriteMsg);
  593. X    if (consoleReadMsg)
  594. X        DeleteStdIO (consoleReadMsg);
  595. X}
  596. X
  597. Xint OpenConsole (writerequest,readrequest,window)
  598. Xstruct IOStdReq *writerequest,*readrequest;
  599. Xstruct Window *window;
  600. X{
  601. X    register int error;
  602. X    writerequest->io_Data=(APTR)window;
  603. X    writerequest->io_Length=sizeof(*window);
  604. X    error=OpenDevice ("console.device",0,writerequest,0);
  605. X    readrequest->io_Device=writerequest->io_Device;
  606. X    readrequest->io_Unit  =writerequest->io_Unit;
  607. X    return (error);
  608. X}
  609. X
  610. XQueueRead (request,whereto)
  611. Xstruct IOStdReq *request;
  612. Xchar *whereto;
  613. X{
  614. X    request->io_Command=CMD_READ;
  615. X    request->io_Data=(APTR)whereto;
  616. X    request->io_Length=1;
  617. X    SendIO (request);
  618. X}
  619. X
  620. X    /* Call checkinput() every so often to find out what the user is doing:
  621. X     * a -ve number -1,-2 ... means the user has selected menu item 1,2 ...
  622. X     * a +ve number means the user has typed a character, 1000 means the
  623. X     * closewindow gadget has been selected, so do your ARE YOU SURE routine
  624. X     * then call finish() and wind up. 0 means nothing's happened. */
  625. X
  626. Xshort checkinput ()
  627. X{
  628. X    if (con_message=(struct IntuiMessage *)GetMsg (mywindow->UserPort))
  629. X    {
  630. X        class=con_message->Class;
  631. X        code=con_message->Code;
  632. X        ReplyMsg (con_message);
  633. X        if (class==CLOSEWINDOW)
  634. X            return ((short)1000);
  635. X        if (class==MENUPICK && code!=MENUNULL)
  636. X            return ((short)(-1-ITEMNUM (code)));
  637. X    }
  638. X    if (GetMsg (consoleReadPort))
  639. X    {
  640. X        code=letter;
  641. X        QueueRead (consoleReadMsg,&letter);
  642. X        return ((short)code);
  643. X    }
  644. X    return ((short)0);
  645. X}
  646. X
  647. X    /* Writechar() writes a character to the window ... to get a response from
  648. X     * typed input, call it immediately with any characters returned from
  649. X     * checkinput(). */
  650. X
  651. Xwritechar (c)    /* NOTE - MUST BE CALLED WITH THE CHARACTER CAST TO TYPE LONG*/
  652. Xchar c;            /* Don't blame me, I don't know why, blame the Amiga */
  653. X{                /* systems programmers. */
  654. X    consoleWriteMsg->io_Command=CMD_WRITE;
  655. X    consoleWriteMsg->io_Data=(APTR)&c;
  656. X    consoleWriteMsg->io_Length=1;
  657. X    DoIO (consoleWriteMsg);
  658. X    if (c=='\n')
  659. X    {
  660. X        column=0;
  661. X        line++;
  662. X    }
  663. X    if (c!='\n')
  664. X        column++;
  665. X    if ((line<<3)+YOFFSET > mywindow->Height)
  666. X    {
  667. X        print ("MORE...");
  668. X        while (checkinput ()<1 || checkinput ()==1000)
  669. X            ;
  670. X        line=0;
  671. X        print ("\r       \r");
  672. X
  673. X    /* This is to prevent a large quantity of text from scrolling off the top
  674. X     * of the window before the user has time to read it all e.g. in
  675. X     * adventure games. Remove it if you don't need it. Note - don't let the
  676. X     * user make the window too small vertically or an infinite loop occurs.*/
  677. X
  678. X    }
  679. X}
  680. X
  681. X    /* Print() does a formatted (i.e. trying not to split up words on the ends
  682. X     * of lines) print of a null-terminated string; very useful for text-
  683. X     * oriented applications in a variable-sized window. */
  684. X
  685. Xprint (string)
  686. Xchar *string;
  687. X{
  688. X    short x;
  689. X    for (;;)
  690. X    {
  691. X        x=0;
  692. X        while (string[x]!='\0' && string[x]!=' ' && string[x]!='\n')
  693. X            x++;
  694. X        if (((column+x)<<3)+XOFFSET > mywindow->Width && column)
  695. X        {                            /* If word would go off end of line, */
  696. X            writechar ((long)'\n');    /* go on to next line before print */
  697. X        }
  698. X        consoleWriteMsg->io_Command=CMD_WRITE;
  699. X        consoleWriteMsg->io_Data=(APTR)string;
  700. X        consoleWriteMsg->io_Length=x;
  701. X        DoIO (consoleWriteMsg);
  702. X        column+=x;
  703. X        if (string[x]=='\n')
  704. X            writechar ((long)'\n');
  705. X        if (string[x]==' ')
  706. X            writechar ((long)' ');
  707. X        if (string[x]=='\0')
  708. X            break;
  709. X        string+=x+1;
  710. X    }
  711. X}
  712. X
  713. Xnprint (string)        /* Non-formatted print */
  714. Xchar *string;
  715. X{
  716. X    consoleWriteMsg->io_Command=CMD_WRITE;
  717. X    consoleWriteMsg->io_Data=(APTR)string;
  718. X    consoleWriteMsg->io_Length=-1;
  719. X    DoIO (consoleWriteMsg);
  720. X}
  721. X
  722. Xresetscroll ()        /* Reset scroll pause feature */
  723. X{
  724. X    line=0;
  725. X}
  726. END_OF_FILE
  727. if test 6098 -ne `wc -c <'console.c'`; then
  728.     echo shar: \"'console.c'\" unpacked with wrong size!
  729. fi
  730. # end of 'console.c'
  731. fi
  732. if test -f 'input.c' -a "${1}" != "-c" ; then 
  733.   echo shar: Will not clobber existing file \"'input.c'\"
  734. else
  735. echo shar: Extracting \"'input.c'\" \(3067 characters\)
  736. sed "s/^X//" >'input.c' <<'END_OF_FILE'
  737. X
  738. X/* Text input routine by Russell Wallace 1987. Feel free to copy it and use it
  739. X * in your own programs. Requires linkage to my set of console routines,
  740. X * console.o. Backspace and cursor keys can be used. DEL key puts
  741. X * linefeed character in string, RETURN key ends input. Selection of menu
  742. X * item or closewindow gadget will break off input and return -ve number,
  743. X * otherwise length of typed-in string returned. Existing text is displayed
  744. X * for editing; if you don't want that, do a string[0]='\0' before calling. */
  745. X
  746. Xshort input (string,length)
  747. Xunsigned char *string;    /* Address of buffer to put text */
  748. Xlong length;            /* Length of buffer */
  749. X{
  750. X    short c;        /* Key pressed */
  751. X    short x;        /* Position in buffer */
  752. X    short actlen=0;    /* Actual length of typed-in string */
  753. X    register short i;
  754. X    resetscroll ();
  755. X    for (x=0;string[x]!='\0';x++)    /* Convert all CRs in existing string to */
  756. X        if (string[x]=='\n')        /* editable characters */
  757. X            string[x]=127;
  758. X    nprint (string);    /* Non-formatted print on screen for editing */
  759. X    for (;;)
  760. X    {
  761. X        do
  762. X            c=checkinput ();
  763. X        while (!c);
  764. X        if (actlen<x)
  765. X            actlen=x;
  766. X        if (c==1000)    /* Close window ... cancel edit */
  767. X        {
  768. X            actlen=-1000;
  769. X            goto ENDINPUT;
  770. X        }
  771. X        if (c<0)        /* Menu select ... cancel edit */
  772. X        {
  773. X            actlen=c;
  774. X            goto ENDINPUT;
  775. X        }
  776. X        if (c=='\r')    /* Pressed CR ... end edit */
  777. X            goto ENDINPUT;
  778. X        if (c==8 && x)    /* Backspace key */
  779. X        {
  780. X            for (i=x-1;i<actlen;i++)    /* Delete character in string buffer */
  781. X                string[i]=string[i+1];
  782. X            writechar ((long)8);
  783. X            nprint ((long)(string+(--x)));    /* Delete on screen */
  784. X            writechar ((long)' ');
  785. X            for (i=x;i<actlen;i++)
  786. X                writechar ((long)8);
  787. X            actlen--;            /* One fewer characters */
  788. X        }
  789. X        if (c==155)        /* Code indicating a cursor key etc. */
  790. X        {
  791. X            do
  792. X                c=checkinput ();    /* Find out which one */
  793. X            while (!c);
  794. X            if (c==67 && x<actlen)    /* Move right */
  795. X            {
  796. X                writechar ((long)155);
  797. X                writechar ((long)67);
  798. X                x++;
  799. X            }
  800. X            if (c==68 && x)            /* Move left */
  801. X            {
  802. X                writechar ((long)155);
  803. X                writechar ((long)68);
  804. X                x--;
  805. X            }
  806. X            if (c==65 && x>7)        /* Up=back 8 spaces */
  807. X            {
  808. X                x-=8;
  809. X                for (i=0;i<8;i++)
  810. X                {
  811. X                    writechar ((long)155);
  812. X                    writechar ((long)68);
  813. X                }
  814. X            }
  815. X            if (c==66 && x<actlen-7)    /* Down=forward 8 */
  816. X            {
  817. X                x+=8;
  818. X                for (i=0;i<8;i++)
  819. X                {
  820. X                    writechar ((long)155);
  821. X                    writechar ((long)67);
  822. X                }
  823. X            }
  824. X            c=0;
  825. X        }
  826. X        if (c>31 && c<128 && actlen<length-1)
  827. X        {
  828. X            for (i=actlen;i>x;i--)
  829. X                string[i]=string[i-1];
  830. X            string[++actlen]='\0';
  831. X            string[x++]=c;
  832. X            nprint ((long)(string+x-1));
  833. X            for (i=x;i<actlen;i++)
  834. X                writechar ((long)8);
  835. X        }
  836. X    }
  837. XENDINPUT:
  838. X    for (i=0;i<x;i++)
  839. X        if (string[i]==127)        /* Convert peculiar characters back into */
  840. X            string[i]='\n';            /* CRs for use */
  841. X    string[actlen]='\0';        /* Stick null on end of string */
  842. X    for (i=x;i<actlen;i++)
  843. X    {
  844. X        writechar ((long)155);    /* Move cursor to end of string */
  845. X        writechar ((long)67);
  846. X    }
  847. X    writechar ((long)'\n');        /* Print out CR */
  848. X    resetscroll ();        /* This has introduced a pause sufficient for any */
  849. X    return (actlen);                /* preceding text to have been read */
  850. X}
  851. END_OF_FILE
  852. if test 3067 -ne `wc -c <'input.c'`; then
  853.     echo shar: \"'input.c'\" unpacked with wrong size!
  854. fi
  855. # end of 'input.c'
  856. fi
  857. if test -f 'makefile' -a "${1}" != "-c" ; then 
  858.   echo shar: Will not clobber existing file \"'makefile'\"
  859. else
  860. echo shar: Extracting \"'makefile'\" \(240 characters\)
  861. sed "s/^X//" >'makefile' <<'END_OF_FILE'
  862. X.c.o:
  863. X    lc1 -cs -cw -b $*
  864. X    lc2 -v $*
  865. Xmandelbrot_set: mandelbrot_set.o scanfloat.o saveilbm.o input.o console.o
  866. X    blink from c.o+mandelbrot_set.o+scanfloat.o+saveilbm.o+input.o+console.o to mandelbrot_set lib lcm.lib+lc.lib+amiga.lib nd sc sd
  867. END_OF_FILE
  868. if test 240 -ne `wc -c <'makefile'`; then
  869.     echo shar: \"'makefile'\" unpacked with wrong size!
  870. fi
  871. # end of 'makefile'
  872. fi
  873. if test -f 'mandelbrot0.uu' -a "${1}" != "-c" ; then 
  874.   echo shar: Will not clobber existing file \"'mandelbrot0.uu'\"
  875. else
  876. echo shar: Extracting \"'mandelbrot0.uu'\" \(565 characters\)
  877. sed "s/^X//" >'mandelbrot0.uu' <<'END_OF_FILE'
  878. Xbegin 644 mandelbrot_set.doc.info
  879. XMXQ```0``````N0`9`"@`%0`$``,``0##L]``````````````````````````1
  880. XM````!`@`P>'P`````````+4````.```````````````````````H`!4``@`!A
  881. XM>Z@#```````````````____,```____/```____/P``X`__/\``____````XU
  882. XM`____``______``______``_A`#`?``______``Y`(``?``______``X``!`)
  883. XM?``______``______``___X`?``______``______`````````````````#_3
  884. XM___\``#````S``#````PP`#````P,`#'_``P#`#````__P#'_````P#``````
  885. XM`P#``````P#`>_\_@P#``````P#&_W__@P#``````P#'__^_@P#``````P#`8
  886. XM`````P#```'_@P#``````P#``````P#______P`````````````+.DUO<W0O>
  887. X%36]S=`#`C
  888. X``
  889. Xend
  890. Xsize 365
  891. END_OF_FILE
  892. if test 565 -ne `wc -c <'mandelbrot0.uu'`; then
  893.     echo shar: \"'mandelbrot0.uu'\" unpacked with wrong size!
  894. fi
  895. # end of 'mandelbrot0.uu'
  896. fi
  897. if test -f 'mandelbrot1.uu' -a "${1}" != "-c" ; then 
  898.   echo shar: Will not clobber existing file \"'mandelbrot1.uu'\"
  899. else
  900. echo shar: Extracting \"'mandelbrot1.uu'\" \(1223 characters\)
  901. sed "s/^X//" >'mandelbrot1.uu' <<'END_OF_FILE'
  902. Xbegin 644 mandelbrot_set.info
  903. XMXQ```0``````.0`2`$8`)@`%``,``0#%.[``````````````````````````D
  904. XM`````_P``````````````#4````'``````````````````````!&`"4``@`"J
  905. XMKM`#``````````````0````````````"````````````!P```````````!_@-
  906. XM```````````P<```````````(#```````````#E@```````````/P```````8
  907. XM```#___`````````'@@&.````````&$``"8```````&````!@``````&````T
  908. XM`,````/@"`````!@```.'#``````Z```-@<@`````!``%F`1X``````8`%O@T
  909. XM"\``````&``>@`/```````P``,`&@``````$``!@'*``````(```'_"`````E
  910. XM`$@`````P``````P`````&`````#8``````R`````,``````#P````<`````#
  911. XM``/````,````````.0``<`````````?\`\``````````/_T``````````!'`+
  912. XM```````````@0```````````*,```````````#^````````````.````````5
  913. XM````"`````````````(````````````$`````````````@````````````<`7
  914. XM```````````9H```````````+[```````````#_P```````````^X```````E
  915. XM````#\```````````^?_P````````!WW^?@```````!>___>```````!____U
  916. XM_X```````______````#X`______X```#_PO_____S@``#G_/______P`!9_R
  917. XM[Y______^`!;W_7______^@`'O_]O______\``"__O_______```?^S?____@
  918. XM_]@``!_`______^X`````/______\`````!?_____.``````/?_____`````%
  919. XM``[____[```````#____^````````"[__Y`````````'^__``````````#_\V
  920. XM```````````>P```````````/\```````````#?````````````[@```````/
  921. X<````#@````````````@``````````````````#?`-
  922. X``
  923. Xend
  924. Xsize 838
  925. END_OF_FILE
  926. if test 1223 -ne `wc -c <'mandelbrot1.uu'`; then
  927.     echo shar: \"'mandelbrot1.uu'\" unpacked with wrong size!
  928. fi
  929. # end of 'mandelbrot1.uu'
  930. fi
  931. if test -f 'mandelbrot_.uu' -a "${1}" != "-c" ; then 
  932.   echo shar: Will not clobber existing file \"'mandelbrot_.uu'\"
  933. else
  934. echo shar: Extracting \"'mandelbrot_.uu'\" \(19935 characters\)
  935. sed "s/^X//" >'mandelbrot_.uu' <<'END_OF_FILE'
  936. Xbegin 644 mandelbrot_set
  937. XM```#\P`````````"``````````$```Q)```"`0```^D```Q)2.=^_DOO`#0D/
  938. XM2"0`2?D`````+'@`!"E.`$`I3P!,0JP`2)/)3J[^VB9`*6L`F``X2JL`K&<`)
  939. XM`'`@#9"M``0&@````(`I0``$80`!>B!K`*S1R-'((F@`$-/)T\D@`G(`$ADI0
  940. XM20!4T(%2@$)G4H`"0/_^G\!5@$)W"``@`E.`U($?L@``(`!3@E'(__8?O``@(
  941. XM(`!3@A^Q(``@`%'*__@B3R\)8```;"EK`#H`!`:L````@``$80`!#F$``/@I&
  942. XM0`!(+P`D0"`J`"1G$BQL!%P@0"(H```I00`X3J[_@B(J`"!G&B0\```#[4ZN\
  943. XM_^(I0`!09PKEB"!`)V@`"`"D(&P`2"\(2&P``"!H`"0I:``$`%1'^0``!&QR)
  944. XM`"`\````YF`")L%1R/_\3KHFH'``8`0@+P`$+P`@+``L9P0@0$Z03KHCXBQX5
  945. XM``0B;`1<3J[^8DJL!&!G"")L!&!.KOYB2JP$9&<((FP$9$ZN_F)*K`!89P@BC
  946. XM;`!83J[^8DJL`$AG)"(L`#QG!$ZN_]PB+`!09P1.KO_<+'@`!$ZN_WPB;`!(*
  947. XM3J[^AB`?+FP`3$S??WY.=7!D8(!!ZP!<3J[^@$'K`%Q.KOZ,3G5#[`!<<`!.@
  948. XMKOW8*4`$7&?:3G4``$Y5__A"ITAL`1Y.NBX44$\I0`!H0J=(;`$P3KHN!%!/'
  949. XM*4``;'``(&P`;#`H`-@I0`1L.4``JCE``(I(;`"$3KHNM%A/*4``U$J`9@YA1
  950. XM``C,2'@``TZZ(3I83REL`-0`PDAL`*1.NBZB6$\I0`#82H!F#F$`"*9(>``$U
  951. XM3KHA%%A/(&P`V"EH`#($HB!L`-30_``L*4@$IF$`!LIA``<X80`(2$AL!;PO*
  952. XM+`#83KHN<%!/0J<O+`2B3KHM@%!/(&P`V"\H`%9.NBS"6$\@;`#8+R@`5DZZ.
  953. XM+(Q83RE`!*I*@&?<($`K:``4__P[:``8__HO`$ZZ+()83PRM```!`/_\9LHR<
  954. XM+?_Z#$'__V?`ZDD"00`_.T'_^`Q!``5DL.5!3OL0`F```!)@``!H8```<&``1
  955. XM`'I@``"D+RP`V$ZZ+6I83Q`L`-Q3`&8:0BP`W$*G+RP`U$ZZ+>)03T'L`4(I3
  956. XM2`5D8!P9?``!`-Q(>``!+RP`U$ZZ+<103T'L`5(I2`5D2&P%O"\L`-A.NBV6T
  957. XM4$]@`/\^0J=A``#06$]@`/\R2'@``6$``,)83V``_R1*+`#<9PQ"IR\L`-1.'
  958. XMNBU^4$]A-$HL`-QG`/\(2'@``2\L`-1.NBUF4$]@`/[V+RP`V$ZZ+,A83V$`.
  959. XM!SA"ITZZ'ZA83V``_MQ(;`%B+RP`U$ZZ$2I03TJ`9@PO+`#43KHLV%A/8%)(8
  960. XM;`%N3KH4#EA/0BP$<$AX`#)(;`1P3KH.,E!/#$#\&&8&3KH1V&`J3KH1TDALU
  961. XM!'!(;`#>(&P$HB\H``1.N@C,3^\`#$J`9PHO+`#43KHLA%A/3G5.5?]R2.<W_
  962. XM`$AL`8`O+`#43KH0L%!/2H!F#B\L`-1.NBQ>6$]@``322JT`"&=X2&P!DDZZ4
  963. XM$XQ83T(L!'!(>``R2&P$<$ZZ#;!03PQ`_!AF"$ZZ$59@``2B2&P$<$ZZ!I!8'
  964. XM3TAL`:PK0/^**T'_CDZZ$U!83T(L!'!(>``R2&P$<$ZZ#7103PQ`_!AF"$ZZI
  965. XM$1I@``1F2&P$<$ZZ!E183RM`_X(K0?^&2&P!QDZZ$Q183T(L!'!(>``R2&P$@
  966. XM<$ZZ#3A03PQ`_!AF"$ZZ$-Y@``0J2&P$<$ZZ!AA83TAL`>0K0/^J*T'_KDZZQ
  967. XM$MA83T(L!'!(>``R2&P$<$ZZ#/Q03PQ`_!AF"$ZZ$*)@``/N2&P$<$ZZ!=Q8^
  968. XM3TAL`@(K0/^B*T'_IDZZ$IQ83T(L!'!(>``R2&P$<$ZZ#,!03PQ`_!AF"$ZZ&
  969. XM$&9@``.R2&P$<$ZZ!:!83TAL`AXK0/^:*T'_GDZZ$F!83T(L!'!(>``R2&P$5
  970. XM<$ZZ#(103PQ`_!AF"$ZZ$"I@``-V2&P$<$ZZ!6183RM`_Y(K0?^6)"W_HB8M2
  971. XM_Z9.NA9N;Q8@+?^:(BW_GB0M_ZHF+?^N3KH66&X.2&P".DZZ$@!83V``_N!.Q
  972. XMN@_>0J<O+`2B3KHJ`E!/("W_FB(M_YXD+?^J)BW_KDZZ$T8D/$!T``!V`$ZZC
  973. XM%IPK0/_*("W_DBM!_\XB+?^6)"W_HB8M_Z9.NA,>+T``%"`L!&PO00`83KH<O
  974. XM+"]``!P@+P`4+T$`("(O`!@D+P`<)B\`($ZZ%E0K;?^B_](K;?^F_]8D+`1L%
  975. XM4X(J`BM`_\(K0?_&2D5K``*8*VW_JO_:*VW_KO_>?``,1@%`;``"8'X`("W_5
  976. XMVB(M_]XD+?_2)BW_UBM`__(K0?_V*T+_ZB0M__(K0__N)BW_]DZZ&$8K0/^Z2
  977. XM("W_ZBM!_[XB+?_N)"W_ZB8M_^Y.NA@J*T#_LBM!_[9*K0`(9@``Y`Q'`?]LD
  978. XM``&N("W_NB(M_[XD+?^R)BW_MDZZ$C8D/$`0``!V`$ZZ%19L``&*("W_\B(MX
  979. XM__8D+?_R)BW_]DZZ%]HK0/^Z("W_ZBM!_[XB+?_N)"W_ZB8M_^Y.NA>^*T#_X
  980. XMLB`M_[HK0?^V(BW_OB0M_[(F+?^V3KH1Z"0M_]HF+?_>3KH1SBM`_^(@+?_JS
  981. XM*T'_YB(M_^XD+?_R)BW_]DZZ%WHK0/_J*T'_[B0M_^HF+?_N3KH1GBM`_^HK-
  982. XM0?_N)"W_TB8M_]9.NA&**VW_XO_R*VW_YO_V4D<K0/_J*T'_[F``_R`,1P'_/
  983. XM;```S"`M_[HB+?^^)"W_LB8M_[9.NA%4)#Q`$```=@!.NA0T;```J"`M__(BK
  984. XM+?_V)"W_\B8M__9.NA;X*T#_NB`M_^HK0?^^(BW_[B0M_^HF+?_N3KH6W"M`@
  985. XM_[(@+?^Z*T'_MB(M_[XD+?^R)BW_MDZZ$08D+?^*)BW_CDZZ$.PK0/_B("W_C
  986. XM\BM!_^8B+?_V)#Q`````=@!.NA:8)"W_ZB8M_^Y.NA:,)"W_@B8M_X9.NA"XQ
  987. XM*VW_XO_R*VW_YO_V4D<K0/_J*T'_[F``_S`@!TC``H`````?+P`O+`2B3KHG@
  988. XMDE!/(`9(P"(%2,$O`2\`+RP$HDZZ)V!/[P`,("W_VB(M_]XD+?_*)BW_SDZZ<
  989. XM$%PK0/_:*T'_WE)&8`#]G"`M_](B+?_6)"W_PB8M_\9.NA`Z*T#_TBM!_]938
  990. XM16``_69,WP#L3EU.=4Y5__Y(YS``0FW__C(M__X,00`@;%1(P3`M__Y(P-"`\
  991. XM0>P`WB)(T\!T`#01`H(```\`X(HB2-/`=@`V$0*#````\.B+T<!P`#`0`H``C
  992. XM```/+P`O`R\"+P$O+`2F3KHFD$_O`!12;?_^8*),WP`,3EU.=4Y5__Y(YSTP%
  993. XM?@`,1P`%;```T"`'<B+!P4'L!*XB2-/`=``S0@`$(DC3P"8'>`K'Q#-#``8BM
  994. XM2-/`,WP`D``((DC3P#-$``HB2-/`,WP`4@`,(DC3P'8`(T,`#B)(T\`H!\G\"
  995. XM`!1%[`58)DK7Q"-+`!(B2-/`(T,`%B)(T\!Z`!-%`!HB2-/`(T,`'")(T\`S^
  996. XM0@`@T<`@!\'!0^P$T-/`((D@2M'$$(4@2M'$$7P`'P`!($K1Q!%\``$``B!*4
  997. XMT<0Q0@`$($K1Q#%\``$`!B!*T<0A0P`(U<0E0P`04D=@`/\L0JP%-D'L`5(IQ
  998. XM2`5D0>P"4BE(!7A![`)D*4@%C$'L`G(I2`6@0>P"?BE(!;1,WPR\3EU.=4*L2
  999. XM!;QP`#E`!<`Y0`7".7P`507$.7P`"@7&.7P``07(0>P"A"E(!<I![`2N*4@%7
  1000. XMSDYU2JP`V&<*+RP`V$ZZ):983TJL`-1G"B\L`-1.NB6"6$\O+`!L3KHD7%A/S
  1001. XM+RP`:$ZZ)%)83TYU3E7_ZDCG!P!Z`"X%(&T`"!`P<``,```P;08,```Y;QX0P
  1002. XM,'``#```+6<4$#!P``P``"YG"DHP<`!G!%)'8,X@;0`($#!P``P``"UF)GH!0
  1003. XM4D<0,'``#```,&T&#```.6\2$#!P``P``"YG"'``<@!@``%0$#!P`$H`9@AP"
  1004. XM`'(`8``!0-#'?@`K2``((&T`"!`P<``,```P;0H,```Y;@121V#H+`="K?_R&
  1005. XM0JW_]BM\/_```/_J*WP`````_^Y31TI':U8@;0`($#!P`$B`2,`$@````#!.Z
  1006. XMNA:*)"W_ZB8M_^Y.NA,:)"W_\B8M__9.N@U&*T#_\B`M_^HK0?_V(BW_[B0\]
  1007. XM0"0``'8`3KH2\BM`_^HK0?_N4T=@IBM\/[F9F?_J*WR9F9F9_^X@;0`($#!@:
  1008. XM``P``"YF;B`&(`920"X`(&T`"!`P<``,```P;5@,```Y;E(0,'``2(!(P`2`I
  1009. XM````,$ZZ%?XD+?_J)BW_[DZZ$HXD+?_R)BW_]DZZ#+HK0/_R("W_ZBM!__8B:
  1010. XM+?_N)#Q`)```=@!.NA`.*T#_ZBM!_^Y21V":2D5G#B`M__(B+?_V3KH3^F`*_
  1011. XM("W_\B(M__9.<4S?`.!.74YU3E7_LDCG/`!(>`/N+RT`$$ZZ(5903RM`_[9*>
  1012. XM@&8&<`%@``1L<``@;0`(,!`B`.>!=``T*``"%B@`!7@`&"@`!1M#_\\"@P``_
  1013. XM`/]Z`>>E*T#_V"M`__0K0?_\(@).NAUF*T'_^"M!_]PB!$ZZ'5@&@```$`!"A
  1014. XMIR\`*T'_X"M%_^1.NB$R4$\K0/_*2H!F$"\M_[9.NB#P6$]P`F```_(I;?_*8
  1015. XM!=Q(;`*,80`#[%A/6*P%W$AL`I)A``/>6$](;`*880`#U%A/2'@`%&$`!`18R
  1016. XM3R\M__QA``1&6$\O+?_X80`$/%A/0J=A``0T6$]"IV$`!"Q83R!L!=P0K?_/5
  1017. XM4JP%W'``(&P%W!"`4JP%W"!L!=P0O``!4JP%W"!L!=P0@%*L!=Q"IV$``_98[
  1018. XM3W``(&P%W!"`4JP%W"!L!=P0@%*L!=PO+?_\80`#UEA/+RW_^&$``\Q83TAL-
  1019. XM`IYA``,\6$\@+?_DY8B0K?_D+P!A``-D6$]"K?_P(BW_\+*M_^1L2"`!T(!RW
  1020. XM`"!M``PR,`@`(`'@B.F`(&P%W!"`4JP%W"`!`H````#P(&P%W!"`4JP%W`*!#
  1021. XM````#^F!(&P%W!"!4JP%W%*M__!@KB`M_^3EB)"M_^0(````9PH@;`7<0A!29
  1022. XMK`7<2&P"I&$``K!83R!L!=Q8K`7<0JW_\"M(_\8B+?_PLJW_^&P``=!"K?_LT
  1023. XM<``0+?_/)"W_[+2`9``!M"`"Y8`O0``0("W_]"(M__!.NAN8(FT`""(O`!`@;
  1024. XM<1@(T<!P`"M`_]0K0/_0*TC_PE*M_]0@+?_4L*W_]&TJ(@!$@20M_]#2@E*!%
  1025. XM(&P%W!"!4JP%W"!M_\(B;`7<$K`H`%*L!=Q@``%`(&W_PA(P"``4,`C_L@)G"
  1026. XMN"(`1($D+?_0TH)2@2)L!=P2@5*L!=PB;`7<$K`H`%*L!=PK0/_04JW_U"`M8
  1027. XM_]2PK?_T;3@B+?_0D(%3@"!L!=P0@%*L!=PK0?_H(BW_Z+*M_]1L``#:(&W_S
  1028. XMPB)L!=P2L!@`4JP%W%*M_^A@WB!M_\(B+?_4$#`8`!0P&/^P`F:F4JW_U"`M.
  1029. XM_]2PK?_T;3@B+?_0D(%3@"!L!=P0@%*L!=PK0?_H(BW_Z+*M_]1L``"`(&W_9
  1030. XMPB)L!=P2L!@`4JP%W%*M_^A@WB!M_\(B+?_4$#`8`!0P&/^P`F8`_TP@+?_0P
  1031. XMDH`,@0````)O`/[.5X$@;`7<$(%2K`7<*T#_Z"`M_]15@"0M_^BT@&P6(&W_2
  1032. XMPB)L!=P2L"@`4JP%W%*M_^A@W"`M_]15@"M`_]!@`/Z,0JW_T%*M_^Q@`/Y`[
  1033. XM4JW_\&``_B@@+`7<D*W_Q@@```!G"B!L!=Q"$%*L!=P@+`7<D*W_QEF`*T#_L
  1034. XMNB`L!=R0K?_*48`I;?_&!=PO+?^Z*T#_OF$``+Q83R!M_\I8B"E(!=PO+?^^<
  1035. XM80``J%A/("W_OE"`+P`O+?_*+RW_MDZZ'5I/[P`,(BW_OE"!L(%G"'`#*T#_2
  1036. XM\&`$0JW_\"\M_[9.NATD6$\@+?_@(BW_W$ZZ&58B+?_83KH93@:````!]"\`_
  1037. XM+RW_RDZZ'4903R`M__!,WP`\3EU.=4Y5```@;0`((FP%W!*04JP%W")L!=P2I
  1038. XMJ``!4JP%W")L!=P2J``"4JP%W")L!=P2J``#4JP%W$Y=3G5.50``2.<@`"`M*
  1039. XM``@B`'08Y*D@;`7<$(%2K`7<(@!T$.2I(&P%W!"!4JP%W"(`X(D@;`7<$(%2+
  1040. XMK`7<(&P%W!"`4JP%W$S?``1.74YU3E4``"`M``@B`.")(&P%W!"!4JP%W"!LR
  1041. XM!=P0@%*L!=Q.74YU3E7_^$CG(0!";?_Z3KH&XD)M__P@;0`(,BW__!`P$`!*S
  1042. XM`&<6$#`0``P```IF!A&\`'\0`%)M__Q@VB\M``A.N@:`6$].N@1*.T#__DIM]
  1043. XM__YG\C(M__PT+?_ZM$%L!#M!__HT+?_^#$(#Z&8*.WS\&/_Z8``![DI":@@[W
  1044. XM0O_Z8``!X@Q"``UG``':44)F9DI!9V)302X!OFW_^FP2(`=(P"!M``@1L`@!!
  1045. XM<`!21V#H2'@`"$ZZ!'!83U-M__P@;0`(T.W__"`(+P!.N@7V6$](>``@3KH$Q
  1046. XM4%A//BW__+YM__IL#DAX``A.N@0\6$]21V#L4VW_^@QM`)O__F8``-I.N@.0\
  1047. XM.T#__DIM__YG\@QM`$/__F8B,BW__+)M__IL&$AX`)M.N@0`6$](>`!#3KH#8
  1048. XM]EA/4FW__`QM`$3__F8>2FW__&<82'@`FTZZ`]I83TAX`$1.N@/06$]3;?_\N
  1049. XM#&T`0?_^9BXR+?_\#$$`!V\D46W__'X`#$<`"&P82'@`FTZZ`Z183TAX`$1.E
  1050. XMN@.:6$]21V#B#&T`0O_^9C8P+?_Z2,!?@#(M__Q(P;*`;"10;?_\?@`,1P`(@
  1051. XM;!A(>`";3KH#9EA/2'@`0TZZ`UQ83U)'8.)P`#M`__XR+?_^#$$`'V\`_F0,P
  1052. XM00"`;`#^7"`M``Q3@#(M__I(P;*`;`#^2CXM__J^;?_\;Q(@!TC`(&T`"!&P*
  1053. XM"/]P`%-'8.A2;?_Z(&T`"#`M__I",```,"W__%)M__PR+?_^$8$``-#M__Q3Y
  1054. XMB"`(+P!.N@1\6$\^+?_\OFW_^FP`_?)(>``(3KH"REA/4D=@ZGX`OFW__&P8!
  1055. XM(&T`"!`P<``,``!_9@81O``*<`!21V#B(&T`"#`M__I",```/BW__+YM__ILQ
  1056. XM&$AX`)M.N@*&6$](>`!#3KH"?%A/4D=@XDAX``I.N@)N6$].N@0T,"W_^DS??
  1057. XM`(1.74YU``!.5?_X2.<`('``.4`%XCE`!>`I;0`,`L8I;0`(`LI(;`*L3KH;B
  1058. XMP%A/*4`"[$J`9P``J$*G2&P"\$ZZ%ZY03RE``N1*@&<``))"ITAL`OY.NA>8X
  1059. XM4$\I0`+H2H!G?"\L`N1.NAAB6$\I0`+<2H!G:B\L`NA.NAA06$\I0`+@2H!G#
  1060. XM6"\L`NPO`"\L`MQA``#$3^\`#$J`9D)(;`7L+RP"X&$``/Y03W``(&P"Z!`HH
  1061. XM``\D;`+L(FH`5G(`$BD`#TAX``(O*@`R*T#__"M!__A.NAJ:4$\@+`+L8`9A=
  1062. XM```D<`!,WP0`3EU.=2\L`N!.NAG\6$\O+`+<3KH9MEA/80).=4JL`NQG"B\L_
  1063. XM`NQ.NAJ>6$]*K`+D9PHO+`+D3KH79%A/2JP"Z&<*+RP"Z$ZZ%U183TJL`MQGX
  1064. XM"B\L`MQ.NA>>6$]*K`+@9PHO+`+@3KH7CEA/3G5.5?_\2.<!`"!M``@A;0`0%
  1065. XM`"@A?````(0`)'``+P`O""\`2&P#"DZZ&11/[P`0+@`@;0`((FT`#"-H`!0`S
  1066. XM%"-H`!@`&"`'3-\`@$Y=3G5.50``(&T`"#%\``(`'"%M``P`*'`!(4``)"\(!
  1067. XM3KH9&%A/3EU.=2!L`NPO*`!63KH8;EA/*4`%[DJ`9TX@0"EH`!0%Y'(`,B@`_
  1068. XM&"E!!>@O`$ZZ&&!83R(L!>0,@0```@!F!C`\`^A@4`R!```!`&8:(BP%Z`R!4
  1069. XM``#__V<.ZH$"@0```#]P_Y"!8"XO+`+H3KH8#EA/2H!G'G``$"P%["E`!>A(2
  1070. XM;`7L+RP"X&$`_U103R`L!>A@`G``3G5.50``2.<@`"!L`MPQ?``#`!Q![0`+<
  1071. XM(FP"W"-(`"AP`2-``"0O+`+<3KH8/EA/$"T`"PP```IF$G(`.4$%XC(L!>`D%
  1072. XM`5)".4(%X`P```IG"C`L!>)20#E`!>(P+`7@2,#G@`:`````)R!L`NPR*``*L
  1073. XM2,&P@6\H2&P#&F$J6$]A`/[L#$```6WV80#^X@Q``^AG[$)L!>!(;`,B80I8)
  1074. XM3TS?``1.74YU3E7__DCG(`!";?_^(&T`"#(M__X0,!``2@!G%@P``"!G$!`PR
  1075. XM$``,```*9P92;?_^8-HP+`7B2,`R+?_^2,'0@>>`!H`````:(&P"[#(H``A(U
  1076. XMP;"!;Q!*;`7B9PI(>``*80#^^%A/(&P"W#%\``,`'"!L`MPA;0`(`"@P+?_^_
  1077. XM2,`@;`+<(4``)"\(3KH7-EA/,"P%XC(M__[003E`!>(@;0`($#`0``P```IF;
  1078. XM"DAX``IA`/ZH6$\@;0`(,BW__A`P$``,```@9@I(>``@80#^C%A/(&T`"#(M%
  1079. XM__X0,!``2@!G#$C!4H'3K0`(8`#_'$S?``1.74YU3E4``"!L`MPQ?``#`!P@_
  1080. XM;`+<(6T`"``H</\@;`+<(4``)"\L`MQ.NA:D6$].74YU0FP%X$YU``!.50``O
  1081. XM*6T`"``<2JP`(&<4,'P``2)L`""SR&<(2'@`"$Z16$].74YU````,```!2+_B
  1082. XM___^2.<_0&$``!I,WP+\3G5(YS]`80``"$S?`OQ.=0A"`!](0$A"/#R``#X\!
  1083. XM?_`X`,A&N4`Z`,I'NT#,0KU"SD*_0KI'9@``[`Q%?_!F```NL$)M```2+@".F
  1084. XM@68```XN`HZ#9P``#"`"(@-.^0``(DZ\1&<``(1.^0``(BY*168``$9(0&8`2
  1085. XM`"I*@68``"1(0F8``!!*@V8```K(1D[Y```AX"`"(@-(0+U`OT!(0$YU2$)F8
  1086. XM```>2H-F```82$"Y0+M`2$!.=7X0FD>_0+]"2$!(0KQ$9P``*)*#9@``"I&"8
  1087. XM9@``!DYUD8)J```(1(%`@#@&3OD``"#@3OD``"(@TH/1@@R``"```&T``!3B^
  1088. XMB.*1?@#3A]&'!D4`$`Q%?^!E```(3OD``"(*2$#018!$2$!.=6X```K%0,=!'
  1089. XMS43/10Q%?_!G```P2D=F``!"2$)F```02H-F```*N4"[0$A`3G76@]6"2D5F6
  1090. XM```J2$#2@=&`8```)DJ`9@``#DJ!9@``"$[Y```B($[Y```B3@I"`!!(0@I`#
  1091. XM`!!(0)Y%1D?H1P1%`"`,1P`T;@``'M*!T8`,1P`@;P``("8"=``$1P`@[JMTM
  1092. XM`&```#0&10`02$#018!$2$!.=0Q'`!!O```.-@)(0T)"2$($1P`0(D8L`NZJ5
  1093. XM[K[NJ[6&O8,L";Q$9@``/M*#T8(&10`0XHCBD0R``"```&T```H&10`0XHCB#
  1094. XMD7X`TX?1ATA`T$4,17_P9```"(!$2$!.=4[Y```B"I^'DX.1@@R``"```&T`T
  1095. XM_JI$A]*'?@#1A^*(XI$&10`02$#018!$2$!.=0``#(`"````;0``$.*(XI%*X
  1096. XM16P``$Y@```*!$4`$&P``$)$1>A-6$4,10`Y;P``$$[Y```AZC(`0D!(0$A!K
  1097. XM!$4`$&[R!D4`$"0`ZJCJNNJIL8*U@70`TX+1@DA`N4!(0$YU)`#HB.B:Z(FQ*
  1098. XM@K6!=`#3@M&"2$#010Q`?_!E!D[Y```B"KE`2$!.=4J`:P``.$J":@``($J`;
  1099. XM9@``:$J!9@``8DJ#9@``7`R"@````&8``%).=;""9@``#+:!90``1&8``#A.I
  1100. XM=4J":P``'F8``"Q*@V8``"9*@68``"`,@(````!F```63G6T@&8```RR@V4`1
  1101. XM`!!F```$3G5*.0``',A.=4HY```<R4YU_P$``$CG/T!A```(3-\"_$YU/#R`-
  1102. XM`#X\?_!(0$A".`#(1KE`S$*]0KU$L$=M``!ZL$)M```N#(```'_P9@``"$J!G
  1103. XM9P``"$[Y```B3K1';0``(@R"``!_\&8```A*@V<```P@`B(#3OD``").3OD`@
  1104. XM`"(N2H)F```L2H-F```F2.?`P$AY`````TZY```9*%A/3-\#`R`\``!_\+E`>
  1105. XM<@!(0$YU3OD``"(@M$=M```B#((``'_P9@``"$J#9P``#"`"(@-.^0``(DY.'
  1106. XM^0``(>`Z`,I'9@``,$J`9@``($J!9@``&DJ"9@``#DJ#9@``"$[Y```B+D[Y/
  1107. XM```AX$ZY```A>&````B[0`I``!#.0F8``"A*@F8```Q*@V8```9@`/]@Q4#'^
  1108. XM0<]%3KD``"%XQ4#'0<]%8```"+]""D(`$`1'/^":1V@```A.^0``(@I(0"X!`
  1109. XMZ8CIB>F?LT>_0$A"+@-\"^VJ[:OMO[='OT)(1#@%(D1(0H#".`!(03`!0D%(X
  1110. XM0CH"RL1(0SP#S,1(0SX#SL1(1]Y&2$="1DA&W862AY&&9```"%-$TH/1@D)#>
  1111. XM2$0L`$A"@,)H```80D0@!I*#2$*1@DA`2$$P`4)!8```*C@`2$$P`4)!2$(\L
  1112. XM`LS$+@-(1\[$2$?<1TA&0D?=1TA&DH>1AF0``!)31-*#T8)E```(4T32@]&"P
  1113. XM+`!(0H#":```%$)%(`9(0I!"2$!(03`!8```%#H`2$$P`4A"/`+,Q9"&9```Z
  1114. XM#E-%T()E```&4T70@DA%2$*`PF@```1P_SH`(`0B!2@).@1(1$[Y```;P$CG2
  1115. XM/T!A```(3-\"_$YU/#R``#X\?_!(0$A".`#(1KE`S$*]0KU$L$=M``!6L$)MM
  1116. XM```N#(```'_P9@``"$J!9P``"$[Y```B3K1';0``'`R"``!_\&8```A*@V<`K
  1117. XM``P@`B(#3OD``").2H)F```.2H-F```(3OD``"(N3OD``"(@M$=M```T#((`/
  1118. XM`'_P9@``"$J#9P``#"`"(@-.^0``(DY*@&8```Y*@68```A.^0``(BY.^0``P
  1119. XM(B`Z`,I'9@``'DJ`9@``#DJ!9@``"$[Y```AX$ZY```A>&````B[0`I``!#.[
  1120. XM0F8``"I*@F8```Y*@V8```A.^0``(>#%0,=!ST5.N0``(7C%0,=!ST5@```(?
  1121. XMOT(`0@`0!$4_\-I':```"$[Y```B"DA`+@'AB.&)X9^S1[]`2$(N`^&*X8OA%
  1122. XMG[='OT(N`$A'SL,L`DA&S,'>AD)'WT=(1TA!+`',PD)&2$;>ADA#+`/,P$)&C
  1123. XM2$;>ADA`2$(L`,S"QL#>@W8`W8/"PMZ!W8,B`$A!)@)(0\##Q,'1@B0`0D#1N
  1124. XM0$A`2$)"0MZ"T8;"P]*'=`#1@D[Y```;P"\`@Y]G!`A``!].=0R`````(&P`2
  1125. XM`#1(0$A!,`%"001%`0!LZ&```&8%!`,#`@("`@$!`0$!`0$!````````````\
  1126. XM`````````'8`#(```"``;```!N&(4$-(0$I`9@``!NF86$-T`!0[`,#EN-9"B
  1127. XM2$`D`>>IY[JS0K5`Z4N:0VT```Q(0-!%@$1(0$YU1$7H320`ZJCJNNJIL8*U1
  1128. XM@4A`N4!(0$YU2$!(1'H0#(`````@;```%DA`2$$P`4)!!$4!``R`````(&WLM
  1129. XM0D0,@```(`!L```&X8A01$A`2D!F```&Z9A81'P`0_D``"#\'#$``.VXV$9(H
  1130. XM0"P!Z:GIOK-&O4#I3)I$2$!(1$YU``!P`"(`N4!(0$YU2.?`P$AY`````4ZY4
  1131. XM```9*%A/3-\#`W``<@"Y0$A`3G5(Y\#`2'D````"3KD``!DH6$],WP,#(#P`M
  1132. XM`'_PN4!R`$A`3G5(Y\#`2'D````$3KD``!DH6$],WP,#(#Q_\0``<@!.=0@`"
  1133. XM``-G```@2.?`P$AY````!$ZY```9*%A/3-\#`PB```,(P``!`$!_\$A`3G5(T
  1134. XMYSQ`>`!R`&```!I(YSQ`>`!R`$J`9P``.&H```@X/(``1(`,@``@``!D```21
  1135. XM.CQ!($ZY```@X$S?`CQ.=3(`0D!(0$A!.CQ"($ZY```@X$S?`CQ.=0``2.<PY
  1136. XM,BQY````:"!O`!@B;P`<)&\`("9O`"0@+P`H(B\`+"0O`#`F+P`T3J[^I$S?(
  1137. XM3`Q.=4Y5__Q(YR``<``I0``82JT`"&LD)"T`"+2L`\AL&B("YX%![`;$(DC31
  1138. XMP4J19PHB`N>!T<$@"&`(<`DI0`,L<`!,WP`$3EU.=7(`2$!.=4CGP,!(>0``&
  1139. XM``1.N0``&2A83TY5__1(YP`@1>P#-+3\``!G-@@J``(`&V8J""H``0`;9R(@C
  1140. XM*@`$D*H`$"M`__A*@&<2+P`O*@`0+RH`'$ZZ`[)/[P`,)%)@Q"\M``A.N@<><
  1141. XM6$],WP0`3EU.=0``&2A83TS?<&%.5?_V+RT`"$ZZ_S)83RM`__9*@&8$</]@G
  1142. XM*B\M`!`O+0`,(&W_]B\H``1.N@@D3^\`#"M`__I*K``89P1P_V`$("W_^DY=Z
  1143. XM3G5.5?_X("T`"`:`````#"]````@+P``<@`L>``$3J[_.BM`__Q*K?_\9@1P#
  1144. XM`&`T("T`"`:`````#"!M__PA0``(+PA(;`7T80`!"%!/2JP#M&8&*6W__`.TZ
  1145. XM(&W__-#\``P@"$Y=3G5.5?_\+RT`"&&06$\K0/_\2H!F!C!\__\@"$Y=3G5.Z
  1146. XM5?_X2.<!(&$``(!P`"E``!`I0``(*4``#"E``\`I0`/$*4`#N"E``[0I0`.\4
  1147. XM2JP#L&=,("P$:"(L`[#2@%.!(`$B+`1H3KH%$"(L!&A.N@7,4(`N`"`'(`=6H
  1148. XM@.2`Y8`N`"\'80#_%EA/)$"T_```9@1P_V`,+P<O"DZZ`+Q03W``3-\$@$Y=_
  1149. XM3G5.5?_X*VP%]/_\2JW__&<D(&W__"M0__@B;?_\(&W__"`H``@L>``$3J[_D
  1150. XM+BMM__C__D<@I2`7X*4@%]$Y=3G5.50``2.<`(")M``@@:0`$(FT`#"-(I
  1151. XM``21R"*()&T`"$J29@(DB4JJ``1G!B!J``0@B25)``1,WP0`3EU.=0``4W5MQ
  1152. XM``````````````1>.``$7E``!%R@``1>*``$7D1L:%]/<&5N0VYT<&%.5?_\5
  1153. XM("T`#"\`+RT`""M`__QA!E!/3EU.=4Y5_^A(YR$P+BT`#$J';@9P_V```/(,)
  1154. XMAP````AL`GX((`<@!U:`Y(#E@"X`(&T`""M(__31Q]^L`\1#[`/`)%$K2/_P,
  1155. XM*TG_^+3\``!G``"B($H@*@`$($K1P"M(_^PD+?_PM<)C%B)M__0BBB-'``0FG
  1156. XM;?_X)HEP`&```(RUPF8>(E(F;?_T)HD@*@`$(@#2AR=!``0B;?_X(HMP`&!HS
  1157. XM(FW_]+/(9`B?K`/$</]@6+/(9BY*DF<.(A*T@6,(GZP#Q'#_8$+?J@`$2I)G)
  1158. XM$+229@P@0B`H``31J@`$))!P`&`F*TK_^"MM_^S_Z"128`#_6B!M__@@K?_TH
  1159. XMD<@B;?_T(H@C1P`$(`A,WPR$3EU.=4Y5__A(YP$`(&T`#$H89OQ3B)'M``PN^
  1160. XM""!M``A*&&;\4XB1[0`((`@B;0`(T\`K2?_X(BT`$+Z!8P(N`2`'(&T`#&`"3
  1161. XM$MA3@&3Z(&W_^$(P>``@+0`(3-\`@$Y=3G4``$Y5__@O+0`(3KK[IEA/*T#_O
  1162. XM^$J`9@1P_V!((&W_^`@H``,``V<22'@``D*G+RT`"$ZZ_$)/[P`,+RT`$"\M=
  1163. XM``P@;?_X+R@`!$ZZ!"I/[P`,*T#__$JL`!AG!'#_8`0@+?_\3EU.=0``````3
  1164. XM@$YU<&%.5?_P2.<!,"1M``@,K````"`&`&P``)`2$@P!`"!G#`P!``EG!@P!-
  1165. XM``IF!%**8.A*$F=R("P&`.6`4JP&`$'L!@C1P"M(__P,$@`B9BA2BB"*2A)G9
  1166. XM"@P2`")G!%**8/)*$F8,2'@``4ZZ`J)83V"<0A)2BF"6(&W__""*2A)G&!(28
  1167. XM#`$`(&<0#`$`"6<*#`$`"F<$4HI@Y$H29@)@"$(24HI@`/]H2JP&`&8&(&P`D
  1168. XM2&`$0>P&""E(!@1*K`8`9@``AD'L`YPB2$?L!H@FV2;9)MDFV3:1)FP`2")KK
  1169. XM`"1(>``H+RD`!$AL!HA.NOY$3^\`#$'L!H@B""0\```#[BQL!%Q.KO_B*4`&X
  1170. XMR"`L!L@I0`;0<@0I00;,*4`&V"E!!M3E@"M`__"3R2QX``1.KO[:*T#_]"!M@
  1171. XM__`B;?_T(V@`"`"D?@!@,BQL!%Q.KO_**4`&R"QL!%Q.KO_$*4`&T$'L`ZXBB
  1172. XM""0\```#[2QL!%Q.KO_B*4`&V'X$(`<@!P"```"``8&L!L0@!R`'`(```(`",
  1173. XM@:P&S`"L``"``P;42JP#,&<$<`!@!B`\``"``"X`0JP#4"`'(`<`@`````$IU
  1174. XM0`-,<`$I0`-R(`<@!P"``````BE``VYP`BE``Y0@!R`'`(````"`*4`#D$'Z_
  1175. XM`;XI2``P+RP&!"\L!@!.NM@64$]"ITZZ^9Y83TS?#(!.74YU``!F9F9F9F88+
  1176. XM9@````````````````````!*@&H``!Y$@$J!:@``#$2!80``($2!3G5A```8$
  1177. XM1(!$@4YU2H%J```,1(%A```&1(!.=2\"2$$T`68``")(0$A!2$(T`&<```:$W
  1178. XMP3`"2$`T`(3!,`)(0C(")!].=2\#=A`,00"`9```!N&944,,00@`9```!NF9H
  1179. XM64,,02``9```!N6954-*06L```;CF5-#-`#FJ$A"0D+FJDA#@,$V`#`"-`-(J
  1180. XM0<3!D()D```(4T/0@63^<@`R`TA#Y[A(0,-`)A\D'TYU($(B0R0`)@%(0DA#;
  1181. XMQ,'&P,#!U$-(0D)"T((F"20(3G5.5?_X2.<!('X`1>P&Q+ZL`\AL'DJ29Q0(B
  1182. XM*@`"``-G`F`*+RH`!$ZZ`;183U*'4(I@W"\M``PO+0`(3KK6'E!/3-\$@$Y=S
  1183. XM3G5.5?_\<``B/```,``L>``$3J[^S@*````P`"M`__Q*@&8$<`!@)$JL`#!G<
  1184. XM&B!L`#!.D$J`9@1P`&`00J=(>``43KK_=E!/("W__$Y=3G5AL$YU``!*K`!H)
  1185. XM9A)#[`1(<``L>``$3J[]V"E``&@I;`!4!`A(>``\2'@`^G``+P`O`$AL!#1(:
  1186. XM;`0:2&P#_"\`3KKW*$_O`"!3@&<$</]@`G``3G4``$YU`````EI@```!`$Y56
  1187. XM__Q(YP$`2JP`,&<$3KK_0$*L`!@B+0`()"T`#"8M`!`L;`1<3J[_T"X`#(?_C
  1188. XM____9A(L;`1<3J[_?"E``!AP!2E``RP@!TS?`(!.74YU3E7_^$CG,0)*K``P4
  1189. XM9P1.NO[P0JP`&"`M`!!3@"]``!`B+0`()"T`#"8O`!`L;`1<3J[_OBX`#(?_@
  1190. XM____9A(L;`1<3J[_?"E``!AP%BE``RP@+0`0#(`````"9QP,@`````%G"DJ`Y
  1191. XM9B(@+0`,8!P@!R`'T*T`#&`2(BT`"'0`=@`L;`1<3J[_ODYQ3-]`C$Y=3G4`\
  1192. XM`$Y5``!*K``P9P1.NOY@(BT`""QL!%Q.KO_<<`!.74YU(&\`!""(6)!"J``$O
  1193. XM(4@`"$YU``!(YSP@)B\`&!0O`!]Z_R\%3KD``"[H$@!P`!`!*`!R_[*`6(]F#
  1194. XM!'``8&8O/``!``%(>``B3KD``"ZD)$`J"E"/9@XO!$ZY```N_'``6(]@0"5#0
  1195. XM``H50@`)%7P`!``(0BH`#A5$``]"ITZY```NU"5``!!*@UB/9PHO"DZY```OD
  1196. XM$&`*2&H`%$ZY```LT%B/(`I,WP0\3G4O"B1O``A*J@`*9PHO"DZY```O)%B/_
  1197. XM%7P`_P`(</\E0``4<``0*@`/+P!.N0``+OQ(>``B+PI.N0``+KQ/[P`,)%].`
  1198. XM=0``("\`!$AX`#`O`$ZY```MY%"/3G4@+P`$+P!.N0``+B98CTYU2.<X`"0OB
  1199. XM`!`F+P`42H)F!'``8"@O/``!``$O`TZY```NI"!`*`A0CV8"8.01?``%``@Q%
  1200. XM0P`2(4(`#B`(3-\`'$YU(&\`!"`(9@)@)!%\`/\`"'#_(4``%'#_(4``&'``O
  1201. XM,"@`$B\`+PA.N0``+KQ0CTYU``!(YR`"+'D```1<3.\`!@`,3J[_XDS?0`1.@
  1202. XM=0``+PXL>0``!%PB+P`(3J[_W"Q?3G5(YS`"+'D```1<3.\`#@`03J[_T$S?J
  1203. XM0`Q.=0``+PXL>0```$!,[P`#``A.KO\Z+%].=0``+PXL>0```$`B;P`(("\`$
  1204. XM#$ZN_RXL7TYU+PXL>0```$`B;P`(3J[^VBQ?3G4O#BQY````0"`O``A.KOZV)
  1205. XM+%].=2\.+'D```!`("\`"$ZN_K`L7TYU+PXL>0```$`B;P`(3J[^GBQ?3G4O/
  1206. XM#BQY````0")O``A.KOZ8+%].=2\.+'D```!`(&\`"$ZN_HPL7TYU+PXL>0``;
  1207. XM`$`B;P`(3J[^ABQ?3G4O#BQY````0"!O``A.KOZ`+%].=2\.+'D```!`(F\`;
  1208. XM"$ZN_F(L7TYU+PXL>0```$`@;P`(3.\"`0`,(B\`%$ZN_D0L7TYU```O#BQY(
  1209. XM````0")O``A.KOX^+%].=2\.+'D```!`(F\`"$ZN_C@L7TYU+PXL>0```$`B>
  1210. XM;P`(3J[^,BQ?3G4O#BQY````0")O``A.KOX@+%].=2\.+'D```!`(F\`""`O>
  1211. XM``Q.KOW8+%].=2\.+'D```!L(F\`""`O``Q.KO\6+%].=4CG,`(L>0```&P@>
  1212. XM;P`03.\`#P`43J[^X$S?0`Q.=0``+PXL>0```&PB;P`(3.\``P`,3J[^O"Q?C
  1213. XM3G4``"\.+'D```!L(F\`""`O``Q.KOZJ+%].=2\.+'D```!H(&\`"$ZN_\HL)
  1214. XM7TYU+PXL>0```&@@;P`(3J[_OBQ?3G4O#BQY````:"!O``A.KO^X+%].=2\.I
  1215. XM+'D```!H(&\`"$ZN_Z`L7TYU+PXL>0```&@@;P`(3J[_.BQ?3G4O#BQY````3
  1216. XM:"!O``A.KO\T+%].=2\.+'D```!H3.\#```(3J[^^"Q?3G4``"\.+'D```!H6
  1217. XM(&\`""`O``Q.KO[F+%].=0```^P````[````````+@(``"Y.```MS```+=P`X
  1218. XM`"T:```L]@``+4X``"VF```M*@``+6```"UL```MB@``+;(``"+(```BL```&
  1219. XM(F(``"(Z```B%@``(?8``"&\```@T```($8``"`F```?^```(!H``!_R```?I
  1220. XMV```'Z```!_2```?F@``'\```!^(```?:```'R```!X0```=\```'<0``!V^$
  1221. XM```=D@``'6P``!U2```=N```'38``!V,```=,```'1```!S"```<N@``'#X``
  1222. XM`!OP```;D```&GX``!K<```:5```&DX``!GX```9T@``&N(``!G&````(P``4
  1223. XM``$``#$0```P^```,.0``##0```PO```,*@``#"4```P@```,&@``#!,```PZ
  1224. XM+@``,!0``"_\```OZ```+]0``"_````OK```+XP``"]X```O9```+U```"\\@
  1225. XM```O*```+Q0``"\````N[```+M@``"[````NJ```+HX``"YX```N7@``(MH`7
  1226. XM``$2````#@````````/R```#Z@```1L`````````````````````````````?
  1227. XM`````````````````````````````````````````````````````````````
  1228. XM`````````````````````````````````&1O<RYL:6)R87)Y````````````I
  1229. XM36%N9&5L8G)O="!3970@=C$N,@```````4`````%`!\````/`````````'``?
  1230. XM```````````````!0````!\```$````9````````````````````````````Z
  1231. XM````````````#P```````````0````\`#R`/0`]@#X`/H`_`#^`/\`[P#/`*+
  1232. XM\`CP!O`$\`+P`/``X@#$`*8`B`!J`$P`+@`/`0\$#P@/"P\/#PJJ:6YT=6ET^
  1233. XM:6]N+FQI8G)A<GD`9W)A<&AI8W,N;&EB<F%R>0``4VAO=R!4:71L92!"87(`5
  1234. XM`$AI9&4@5&ET;&4@0F%R``!3879E('-C<F5E;@!%;G1E<B!F:6QE;F%M93H*C
  1235. XM``!%;G1E<B!087)A;65T97)S``!%;G1E<B!8(&-O;7!O;F5N="!O9B!#.@H`W
  1236. XM`$5N=&5R(%D@8V]M<&]N96YT(&]F($,Z"@``16YT97(@8F]T=&]M(&QE9G0@D
  1237. XM6"!C;RUO<F0Z"@``16YT97(@8F]T=&]M(&QE9G0@62!C;RUO<F0Z"@``16YT&
  1238. XM97(@=&]P(')I9VAT(%@@8V\M;W)D.@H``$5N=&5R('1O<"!R:6=H="!9(&-O"
  1239. XM+6]R9#H*``!);G9A;&ED(&-O+6]R9&EN871E<R$*``!$;R!-86YD96QB<F]TK
  1240. XM(%-E=`!$;R!*=6QI82!3970``%-A=F4@4V-R965N`$5X:70``$]P=&EO;G,`U
  1241. XM1D]230``24Q"30``0DU(1```0TU!4```0D]$60``````%``4`1@`9``?```#)
  1242. XM````%`H```````````````````````````!X`%@"@`$```\``````````````
  1243. XM`````````````&UY+F-O;BYW<FET90``;7DN8V]N+G)E860`8V]N<V]L92YD0
  1244. XM979I8V4``$U/4D4N+BX`#2`@("`@("`-`````````(`````#5@``````````<
  1245. XM`````````````````````````````````W@`````````````````````````[
  1246. XM`````````````````````````````````````````````````````````````
  1247. XM``!C;VXZ,3`O,3`O,S(P+S@P+P`J````````````````````````````````?
  1248. XM`````"@J*B!5<V5R($%B;W)T(%)E<75E<W1E9"`J*@``__\````.``X`````S
  1249. XM```#S`````#__P````0`!``````````````#Z$-/3E1)3E5%``#__P````0`G
  1250. XM!`````````00`````$%"3U)4`/__````!``$````````!"X`````:6YT=6ETE
  1251. XM:6]N+FQI8G)A<GD```````````````````````0````#[`````<````!```$H
  1252. XA0```!"8```0,```#]````U8```,T````F`````````/R.
  1253. X``
  1254. Xend
  1255. Xsize 14208
  1256. END_OF_FILE
  1257. if test 19935 -ne `wc -c <'mandelbrot_.uu'`; then
  1258.     echo shar: \"'mandelbrot_.uu'\" unpacked with wrong size!
  1259. fi
  1260. # end of 'mandelbrot_.uu'
  1261. fi
  1262. if test -f 'saveilbm.c' -a "${1}" != "-c" ; then 
  1263.   echo shar: Will not clobber existing file \"'saveilbm.c'\"
  1264. else
  1265. echo shar: Extracting \"'saveilbm.c'\" \(3407 characters\)
  1266. sed "s/^X//" >'saveilbm.c' <<'END_OF_FILE'
  1267. X
  1268. X#include <libraries/dos.h>
  1269. X#include <graphics/rastport.h>
  1270. X
  1271. X#define putbyte(x) {*d++=(x);}
  1272. X
  1273. Xlong Write ();
  1274. Xunsigned char *AllocMem ();
  1275. Xstruct FileHandle *Open ();
  1276. Xunsigned char *d;    /* temp buffer pointer */
  1277. X
  1278. Xint saveilbm (bitmap,colormap,title)    /* returns 0 if no error */
  1279. Xstruct BitMap *bitmap;
  1280. Xunsigned short *colormap;
  1281. Xchar *title;
  1282. X{
  1283. X    int width,height,rowlen,i,j,k;
  1284. X    int numcols,ldepth,lheight,lrowlen;
  1285. X    int p,q;                    /* temp bitmap pointers */
  1286. X    unsigned char depth;
  1287. X    unsigned char *dest;        /* where to put output before writing */
  1288. X    unsigned char *e;            /* temp buffer pointer */
  1289. X    unsigned char *rowstart;    /* addr of start of bitplane row */
  1290. X    long totlen,bodlen;
  1291. X    struct FileInfoBlock *file;
  1292. X    if (!(file=Open (title,MODE_NEWFILE)))
  1293. X        return (1);
  1294. X    rowlen=bitmap->BytesPerRow;
  1295. X    width=rowlen*8;
  1296. X    height=bitmap->Rows;
  1297. X    depth=bitmap->Depth;
  1298. X    lrowlen=bitmap->BytesPerRow;
  1299. X    lheight=bitmap->Rows;
  1300. X    ldepth=bitmap->Depth;
  1301. X    numcols=1<<depth;
  1302. X    if (!(dest=AllocMem ((long)(lrowlen*lheight*ldepth+4096),0L)))
  1303. X    {
  1304. X        Close (file);    /* we're going to store entire output file in */
  1305. X        return (2);        /* memory to work on before writing to disk */
  1306. X    }
  1307. X    d=dest;
  1308. X    putword ("FORM");
  1309. X    d+=4;                /* Leave gap for size which we'll put in later */
  1310. X    putword ("ILBM");
  1311. X    putword ("BMHD");
  1312. X    putlong (20L);
  1313. X
  1314. X        /* Write BMHD block */
  1315. X
  1316. X    putshort (width);
  1317. X    putshort (height);
  1318. X    putshort (0);
  1319. X    putshort (0);
  1320. X    putbyte (depth);
  1321. X    putbyte (0);
  1322. X    putbyte (1);
  1323. X    putbyte (0);
  1324. X    putshort (0);
  1325. X    putbyte (0);
  1326. X    putbyte (0);
  1327. X    putshort (width);
  1328. X    putshort (height);
  1329. X
  1330. X    putword ("CMAP");
  1331. X    putlong (numcols*3);
  1332. X
  1333. X        /* Write color map */
  1334. X
  1335. X    for (i=0;i<numcols;i++)
  1336. X    {
  1337. X        putbyte ((colormap[i]>>8)<<4);
  1338. X        putbyte (colormap[i]&0x00F0);
  1339. X        putbyte ((colormap[i]&0x000F)<<4);
  1340. X    }
  1341. X    if ((numcols*3)&1)        /* if odd length, put pad byte */
  1342. X        putbyte (0);
  1343. X
  1344. X    putword ("BODY");
  1345. X    e=d;
  1346. X    d+=4;            /* leave space to put length in later */
  1347. X
  1348. X        /* Write bitplanes */
  1349. X
  1350. X    for (i=0;i<height;i++)
  1351. X        for (j=0;j<depth;j++)
  1352. X        {
  1353. X            rowstart=(bitmap->Planes[j])+rowlen*i;
  1354. X            p=q=0;
  1355. XL0:
  1356. X            if (++p>=rowlen)
  1357. X            {
  1358. X                putbyte ((char)(-p+q+1));
  1359. X                putbyte (rowstart[q]);
  1360. X                goto ER;
  1361. X            }
  1362. X            if (rowstart[p]==rowstart[p-1])
  1363. X                goto L0;
  1364. X            putbyte ((char)(-p+q+1));
  1365. X            putbyte (rowstart[q]);
  1366. X            q=p;
  1367. XL1:
  1368. X            if (++p>=rowlen)
  1369. X            {
  1370. X                putbyte ((char)(p-q-1));
  1371. X                for (k=q;k<p;k++)
  1372. X                    putbyte (rowstart[k]);
  1373. X                goto ER;
  1374. X            }
  1375. X            if (rowstart[p]!=rowstart[p-1])
  1376. X                goto L1;
  1377. X            if (++p>=rowlen)
  1378. X            {
  1379. X                putbyte ((char)(p-q-1));
  1380. X                for (k=q;k<p;k++)
  1381. X                    putbyte (rowstart[k]);
  1382. X                goto ER;
  1383. X            }
  1384. X            if (rowstart[p]!=rowstart[p-1])
  1385. X                goto L1;
  1386. X            if (p-q>2)
  1387. X            {
  1388. X                putbyte ((char)(p-q-3));
  1389. X                for (k=q;k<p-2;k++)
  1390. X                    putbyte (rowstart[k]);
  1391. X                q=p-2;
  1392. X            }
  1393. X            goto L0;
  1394. XER:
  1395. X            q=0;
  1396. X        }
  1397. X    if ((d-e)&1)
  1398. X        putbyte (0);    /* If body odd length, put pad byte */
  1399. X    bodlen=d-e-4;
  1400. X    totlen=d-dest-8;
  1401. X    d=e;
  1402. X    putlong (bodlen);
  1403. X    d=dest+4;
  1404. X    putlong (totlen);
  1405. X    if (Write (file,dest,totlen+8)!=totlen+8)
  1406. X        i=3;
  1407. X            else
  1408. X                i=0;
  1409. X    Close (file);
  1410. X    FreeMem (dest,(long)(ldepth*lheight*lrowlen+500));
  1411. X    return (i);            /* No error */
  1412. X}
  1413. X
  1414. Xputword (string)
  1415. Xunsigned char *string;
  1416. X{
  1417. X    putbyte (string[0]);
  1418. X    putbyte (string[1]);
  1419. X    putbyte (string[2]);
  1420. X    putbyte (string[3]);
  1421. X}
  1422. X
  1423. Xputlong (n)
  1424. Xunsigned long n;
  1425. X{
  1426. X    putbyte ((unsigned char)(n>>24));
  1427. X    putbyte ((unsigned char)(n>>16));
  1428. X    putbyte ((unsigned char)(n>>8));
  1429. X    putbyte ((unsigned char)n);
  1430. X}
  1431. X
  1432. Xputshort (n)
  1433. Xunsigned int n;
  1434. X{
  1435. X    putbyte ((unsigned char)(n>>8));
  1436. X    putbyte ((unsigned char)n);
  1437. X}
  1438. END_OF_FILE
  1439. if test 3407 -ne `wc -c <'saveilbm.c'`; then
  1440.     echo shar: \"'saveilbm.c'\" unpacked with wrong size!
  1441. fi
  1442. # end of 'saveilbm.c'
  1443. fi
  1444. if test -f 'scanfloat.c' -a "${1}" != "-c" ; then 
  1445.   echo shar: Will not clobber existing file \"'scanfloat.c'\"
  1446. else
  1447. echo shar: Extracting \"'scanfloat.c'\" \(1475 characters\)
  1448. sed "s/^X//" >'scanfloat.c' <<'END_OF_FILE'
  1449. X
  1450. X/* Routine to scan a floating point number from a null-terminated string.
  1451. X * Written 1987 by Russell Wallace. May be freely copied and used in
  1452. X * developing Amiga software. Requires linkage with m.lib if used with
  1453. X * Aztec C. */
  1454. X
  1455. Xtypedef double TYPE;    /* Define this as float or double, whichever reqd. */
  1456. X
  1457. XTYPE scanfloat (string)
  1458. Xchar *string;
  1459. X{
  1460. X    register short i,j,minus;
  1461. X    TYPE number,column;
  1462. X    i=minus=0;
  1463. X    while ((string[i]<'0' || string[i]>'9')&& string[i]!='-' && string[i]!='.' && string[i])
  1464. X        i++;    /* Search for start of number or end of string */
  1465. X    if (string[i]=='-')
  1466. X    {
  1467. X        minus=1;    /* Is negative number */
  1468. X        i++;
  1469. X        if ((string[i]<'0' || string[i]>'9')&& string[i]!='.')
  1470. X            return ((TYPE)0);
  1471. X    }
  1472. X    if (string[i]=='\0')
  1473. X        return ((TYPE)0);    /* If end of string, return 0 */
  1474. X    string+=i;    /* Move along to start of string */
  1475. X    i=0;
  1476. X    while (string[i]>='0' && string[i]<='9')
  1477. X        i++;    /* Look for decimal point */
  1478. X    j=i;
  1479. X    number=0;
  1480. X    column=1;
  1481. X    for (i--;i>=0;i--)    /* Go back from point to start of number */
  1482. X    {
  1483. X        number+=(string[i]-'0')*column;    /* add digit value to number */
  1484. X        column*=10;        /* each column is 10 times value of one to right */
  1485. X    }
  1486. X    column=.1;
  1487. X    if (string[j]=='.')    /* If decimal point, get stuff after it */
  1488. X        for (i=j+1;string[i]>='0' && string[i]<='9';i++)
  1489. X        {                /* scan right to end of number */
  1490. X            number+=(string[i]-'0')*column;
  1491. X            column/=10;        /* each column 10 times less than one to left */
  1492. X        }
  1493. X    if (minus)
  1494. X        return (-number);
  1495. X            else
  1496. X                return (number);
  1497. X}
  1498. END_OF_FILE
  1499. if test 1475 -ne `wc -c <'scanfloat.c'`; then
  1500.     echo shar: \"'scanfloat.c'\" unpacked with wrong size!
  1501. fi
  1502. # end of 'scanfloat.c'
  1503. fi
  1504. echo shar: End of archive 1 \(of 1\).
  1505. cp /dev/null ark1isdone
  1506. MISSING=""
  1507. for I in 1 ; do
  1508.     if test ! -f ark${I}isdone ; then
  1509.     MISSING="${MISSING} ${I}"
  1510.     fi
  1511. done
  1512. if test "${MISSING}" = "" ; then
  1513.     echo You have the archive.
  1514.     rm -f ark[1-9]isdone
  1515. else
  1516.     echo You still need to unpack the following archives:
  1517.     echo "        " ${MISSING}
  1518. fi
  1519. ##  End of shell archive.
  1520. exit 0
  1521. -- 
  1522. Mail submissions (sources or binaries) to <amiga@uunet.uu.net>.
  1523. Mail comments to the moderator at <amiga-request@uunet.uu.net>.
  1524. Post requests for sources, and general discussion to comp.sys.amiga.misc.
  1525.